package com.hb.trans.api

import com.hb.trans.bean.*
import io.reactivex.Observable
import okhttp3.ResponseBody
import retrofit2.http.GET
import retrofit2.http.Query
import retrofit2.http.QueryMap
import retrofit2.http.Url

//const val TRANS_SERVER_PATH = "http://59.110.155.214:18082/"
const val TRANS_SERVER_PATH = "http://101.201.67.77:10017/"
const val TRANS_SERVER_MY_PATH = "https://www.hbjt.org.cn/hbjt/api/"

interface EndPoints {
    @GET("home/list")
    fun getNews(): Observable<Base<HomeList>>

    @GET("article/labelList")
    fun getNewsLabels(): Observable<Base<MutableList<ArticleLabel>>>



    @GET("article/list")
    fun getNewList(@Query("labelId") labelId: String): Observable<Base<MutableList<New>>>
    //23
    //新闻详情
    @GET("article/articleInfo")
    fun getNewDetail(@Query("articleId") id: String): Observable<Base<NewDetail>>

    @GET("navigation/list")
    fun getServes(): Observable<Base<ServeList>>

    @GET("userCenter/aboutUs")
    fun getAboutUs(): Observable<Base<AboutUs>>

    @GET("userCenter/aboutUs")
    fun getVersionInfo(): Observable<Base<VersionInfo>>

    @GET("userCenter/saveFeedback")
    fun commitFeedback(@Query("content") content: String, @Query("tel") tel: String): Observable<Base<String>>

    //验证码
    @GET
    fun securityImage(@Url url: String, @Query("key") key: String): Observable<ResponseBody>

    //登录
    @GET
    fun login(@Url url: String, @QueryMap params: MutableMap<String, Any>): Observable<Base<Student>>

    @GET
    fun getSchoolDetail(@Url url: String, @Query("inscode") schoolId: String): Observable<Base<SchoolDetail>>

    @GET
    fun getPeriodListDetail(@Url url: String, @Query("stunum") stunum: String): Observable<Base<MutableList<PeriodPandect>>>

    @GET
    fun getPeriodDetail(@Url url: String, @Query("stunum") stunum: String, @Query("subject") subject: Int): Observable<Base<MutableList<Period>>>

    @GET
    fun commitEvaluate(@Url url: String, @QueryMap mutableMapOf: MutableMap<String, String>): Observable<Base<Nothing>>

    @GET
    fun getSchools(@Url url: String, @Query("district") district: String): Observable<Base<MutableList<School>>>

    @GET
    fun getCoachInfo(@Url url: String, @Query("coanum") coanum: String): Observable<Base<Coach>>

    @GET
    fun geocoder(@Url url: String, @QueryMap params: MutableMap<String, String>): Observable<Geocoder>

    @GET
    fun getCounties(@Url url: String): Observable<Base<MutableMap<String, MutableList<City>>>>

    @GET
    fun findSchools(@Url url: String, @Query("schName") name: String): Observable<Base<MutableList<School>>>

    //取更新版本号
    @GET
    //192.168.0.45/api/version/getById
    fun getById(@Url url: String): Observable<Base<Update>>

    //取更新版本号
    @GET
    //http://192.168.0.45/api/enroll/save
    fun save(@Url url: String, @QueryMap params: MutableMap<String, Any>): Observable<Base<Save>>

    //统计报名人数
    @GET
        //http://192.168.0.45/api/enroll/enrollCount?inscode=3334499505124449
    fun enrollCount(@Url url: String, @Query("inscode") inscode: String): Observable<Base<EnrollCount>>


}